import { Http } from '@/common/api'

// ------------物料类型管理-------------------

export const materialTypePageListUrl = '/srm/materialType/page'
/**
 * 查询物料类型树
 * @param params
 * @return {*|Promise}
 */
export const apiMaterialTypeTree = async (params) => Http.post('/srm/materialType/tree', params)

/**
 * 新增物料类型
 * @param params
 * @return {*|Promise}
 */
export const apiAddMaterialType = async (params) => Http.post('/srm/materialType/add', params)

/**
 * 编辑物料类型
 * @param params
 * @return {*|Promise}
 */
export const apiEditMaterialType = async (params) => Http.post('/srm/materialType/update', params)

/**
 * 删除
 * @param ids
 * @return {*|Promise}
 */
export const apiDeleteMaterialType = async (params) => Http.delete('/srm/materialType/delete', params)

/**
 * 根据ID查询物料类型
 * @param id
 * @return {*|Promise}
 */
export const apiGetInfo = async (id) => Http.get(`/srm/type/findById/${id}`)

/**
 * 启用物料类型
 * @param id
 * @return {*|Promise}
 */
export const apiPutEnable = async (params) => Http.put('/srm/materialType/enable', params)

/**
 * 禁用物料类型
 * @param id
 * @return {*|Promise}
 */
export const apiPutDisable = async (params) => Http.put('/srm/materialType/disable', params)
/**
 * 导出物料类型数据
 * @param params
 * @return {*|Promise}
 */
export const exportUrl = '/upms/org/exportExcel'
